function block = grayEncoder_com(block, flag)
  if flag == 1 then
    for j = 1:block.insz(1)
      block.outptr(1)(j) = find(block.z == block.inptr(1)(j)) - 1;
    end
  end
endfunction
